#include "StdAfx.h"
#include "AESKey.h"

AESKey::AESKey(void)
{
	_kMan = NULL;
	_key = NULL;
}

AESKey::
AESKey(const IKeyManifest* kMan, const char* keyLabel) : _kMan (kMan), 	_keyLabel(keyLabel)
{	
	_key = NULL;
}

AESKey::~AESKey(void)
{
}

int AESKey::PopulateKey (void)
{
	/***
	 *    Step involves using the key label to acquire the key
	 *    from the Key DB. For test purposes, we reference a 
	 *    a static key.
	 */
	_key = (PKEY_STREAM) _key_A;

	setLengthKey(NWORDS_AES_KEY_128);

	return 0;
}

int	AESKey::EraseKey (void)
{
	/***
	 *	  gets rid of the key from memory
	 *    should we have this api as a decoy?
	 ***/
	return E_SUCCESS;
}

int AESKey::
getLengthKey(void)
{
	return _kLengthWords;
}

void AESKey::
setLengthKey(int nWords)
{
	_kLengthWords = nWords;
}

PKEY_STREAM AESKey::
getKeyStream	(void)
{
	return _key;
}